<?php
/**********************************************************
  eCode Marketing System
  Version 0.1
  Excalibur Template (/templates/excalibur/index.php)
**********************************************************/

/* Check to see if we're being called from another script.
   Stop execution if we aren't. */
if(!defined("FROMSCRIPT")) die("File not directly accessible.");

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title><?php if(isset($pagetitle)) echo $pagetitle . " - "; echo SITE_NAME; ?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_DIR_EXT; ?>/uniformity.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_DIR_EXT; ?>/excalibur<?php if(isset($_GET['printable'])) echo "-print"; ?>.css" />
    <script type="text/javascript" src="<?php echo INCLUDES_DIR_EXT; ?>/jquery.min.js"></script>
    <script type="text/javascript">
    
      $(document).ready(function(){
        // Hide all the elements to be flexpanded.
            $(".flexpanded").hide();
            $(".flexpander p span").show();
        // Toggles the component to be flexpanded
            $(".flexpander").click(function()
        {
            $(this).next(".flexpanded").slideToggle(150);
        });

<?php if(isset($extra_jQuery)) echo $extra_jQuery; ?>

     });
     
    </script>
  </head>
  <body>
    <div id="top">
      <div id="header">
        <?php echo WEBSITE_HEADER; ?>
      </div>
       <?php if(isset($_SESSION['login_t'])) {
        echo "<div id=\"login\">Logged in as " . $_SESSION['displayname'] . " (" . $_SESSION['username'] . ") | <a href=\"/admin/handler.logout.php\">Logout</a>";
        # if($_SESSION['is_admin']) echo " | <a href=\"/admin/list_users.php\">User Admin</a>";
        echo "</div>\n";
        } ?>
      <div id="main">
        <?php echo "<h1>", $pageheading, "</h1>\n", $page_content; ?>
      </div>
      <div id="footer">
        <?php echo str_replace('[YEAR]', date('Y'), WEBSITE_FOOTER); ?>
      </div>
    </div>
  </body>
</html>
